const express = require('express');
const router = module.exports = express.Router();

const newsController = require('../controller/newsController');
const {
    getToken,
    checkToken
} = require('../middlewares/checkToken');


router
    //获取栏目列表
    .get('/category', getToken, newsController.getCategoryList)
    //获取文章列表
    .get('/post', getToken, newsController.getPostList)
    //搜索文章
    .get('/post_search', getToken, newsController.post_search)
    //搜索文章推荐   暂时与文章搜索共用接口
    .get('/post_search_recommend', getToken, newsController.post_search)
    //文章详情接口
    .get('/post/:id', getToken, newsController.getPostDetail)
    // 文章评论列表
    .get('/post_comment/:id', getToken, newsController.getCommentList)